// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   ResourceReader.java

package com.vandagroup.common.webapp;

import java.io.PrintStream;
import java.util.Properties;
import javax.servlet.ServletException;

public class ResourceReader
{

    public static Properties p = new Properties();

    public ResourceReader()
    {
    }

    public synchronized void load()
        throws ServletException
    {
        p.clear();
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        if(classLoader == null)
            classLoader = getClass().getClassLoader();
        try
        {
            java.io.InputStream inputStream = classLoader.getResourceAsStream("com/vandagroup/common/resources/ApplicationResources_zh.properties");
            p.load(inputStream);
            System.out.println("load system resource com/vandagroup/common/resources/ApplicationResources_zh.properties");
        }
        catch(Exception e)
        {
            System.out.println("load properties error");
            e.printStackTrace();
            throw new ServletException("load properties error");
        }
    }

    public static String getMessageFromResource(String key)
    {
        String value = p.getProperty(key);
        return value;
    }

}
